#ifndef ADDATTENTIONSTASK_H
#define ADDATTENTIONSTASK_H

#include "libs/base/task/task.h"

class LiveRecorder;

class AddAttentionsTask : public yc::Task
{
    Q_OBJECT
public:
    AddAttentionsTask(LiveRecorder* recorder, int platform,
                      const QStringList& presenter_platform_ids, QObject* parent = nullptr);
    ~AddAttentionsTask();

private:
    void startImpl() override;
    void addPresenter();
    void onGetLiveInfo(int presenter, const QString& args);
    void addAttentions();
    void addLive();
    void setNewPresenterId(const QString& platform_id, int id);
    void notifyFinished();

    struct NewPresenter
    {
        QString platform_id;
        int id;
    };

    LiveRecorder* recorder_;
    int platform_;
    QList<NewPresenter> new_presenters_;
    int pos_ = 0;
    QString error_ids_;
    int request_id_ = 0;
};

#endif // ADDATTENTIONSTASK_H
